package com.vancouver.knows.business.task;

import java.util.ArrayList;
import java.util.List;

import com.pangu.task.ATaskMarkPool;
import com.vancouver.knows.business.task.mark.AddUserTokenTaskMark;
import com.vancouver.knows.business.task.mark.CommentReportTaskMark;
import com.vancouver.knows.business.task.mark.CountryChooseTaskMark;
import com.vancouver.knows.business.task.mark.DeleteUserBusinessImagesTaskMark;
import com.vancouver.knows.business.task.mark.EmailSendSecurityCodeTaskMark;
import com.vancouver.knows.business.task.mark.EmailUserRegisterTaskMark;
import com.vancouver.knows.business.task.mark.FetchCityDiscountsCategoryTaskMark;
import com.vancouver.knows.business.task.mark.FetchCityDiscountsTaskMark;
import com.vancouver.knows.business.task.mark.FetchCityNewsDetailTaskMark;
import com.vancouver.knows.business.task.mark.FetchCityNewsTaskMark;
import com.vancouver.knows.business.task.mark.FetchCommentsTaskMark;
import com.vancouver.knows.business.task.mark.FetchDiscountDetailTaskMark;
import com.vancouver.knows.business.task.mark.FetchEventDetailTaskMark;
import com.vancouver.knows.business.task.mark.FetchEventsTaskMark;
import com.vancouver.knows.business.task.mark.FetchMyUserPostCommentsTaskMark;
import com.vancouver.knows.business.task.mark.FetchUserBusinessImagesTaskMark;
import com.vancouver.knows.business.task.mark.FetchUserPostCategoriesTaskMark;
import com.vancouver.knows.business.task.mark.FetchUserPostDetailTaskMark;
import com.vancouver.knows.business.task.mark.FetchUserPostsTaskMark;
import com.vancouver.knows.business.task.mark.FollowedTaskMark;
import com.vancouver.knows.business.task.mark.ForgotPasswordTaskMark;
import com.vancouver.knows.business.task.mark.GetUserPostsTaskMark;
import com.vancouver.knows.business.task.mark.HomeMapTaskMark;
import com.vancouver.knows.business.task.mark.HomePageTaskMark;
import com.vancouver.knows.business.task.mark.LiveFeedResultTaskMark;
import com.vancouver.knows.business.task.mark.LoginTaskMark;
import com.vancouver.knows.business.task.mark.MessageRemindTaskMark;
import com.vancouver.knows.business.task.mark.ModifyPasswordTaskMark;
import com.vancouver.knows.business.task.mark.MyArticleTaskMark;
import com.vancouver.knows.business.task.mark.MyAtcommentTaskMark;
import com.vancouver.knows.business.task.mark.MyCommentTaskMark;
import com.vancouver.knows.business.task.mark.MyPointsDetailTaskMark;
import com.vancouver.knows.business.task.mark.MyUserNoticeTaskMark;
import com.vancouver.knows.business.task.mark.PhoneSendSecurityCodeTaskMark;
import com.vancouver.knows.business.task.mark.PhoneUserRegisterTaskMark;
import com.vancouver.knows.business.task.mark.PostPrivacySettingTaskMark;
import com.vancouver.knows.business.task.mark.QueryUserInfoTaskMark;
import com.vancouver.knows.business.task.mark.RenewUserPostTaskMark;
import com.vancouver.knows.business.task.mark.ResetPasswordTaskMark;
import com.vancouver.knows.business.task.mark.SaveShareImgTaskMark;
import com.vancouver.knows.business.task.mark.SearchKeyWordTaskMark;
import com.vancouver.knows.business.task.mark.SearchResultTaskMark;
import com.vancouver.knows.business.task.mark.SplashAdInfoTaskMark;
import com.vancouver.knows.business.task.mark.UploadBusinessPhotosTaskMark;
import com.vancouver.knows.business.task.mark.UploadUserPostTaskMark;
import com.vancouver.knows.business.task.mark.UserDeleteArticleTaskMark;
import com.vancouver.knows.business.task.mark.UserDeleteCommentTaskMark;
import com.vancouver.knows.business.task.mark.UserDeleteFollowTaskMark;
import com.vancouver.knows.business.task.mark.UserDeleteUpvoteTaskMark;
import com.vancouver.knows.business.task.mark.UserFollowTaskMark;
import com.vancouver.knows.business.task.mark.UserGetAuidTaskMark;
import com.vancouver.knows.business.task.mark.UserGetNoticationSettingTaskMark;
import com.vancouver.knows.business.task.mark.UserHashTaskMark;
import com.vancouver.knows.business.task.mark.UserInsertCommentTaskMark;
import com.vancouver.knows.business.task.mark.UserPostArticleTaskMark;
import com.vancouver.knows.business.task.mark.UserRateTaskMark;
import com.vancouver.knows.business.task.mark.UserUploadImageTaskMark;
import com.vancouver.knows.business.task.mark.UserUpvoteTaskMark;
import com.vancouver.knows.business.task.mark.VersionInfoTaskMark;

/**
 * 任务池
 * <p/>
 * Created by cxlin
 */
public class BTaskMarkPool extends ATaskMarkPool {

	private HomePageTaskMark homepageTaskMark;
	private LoginTaskMark loginTaskMark = null;
	private CountryChooseTaskMark countryChooseTaskMark;
	private QueryUserInfoTaskMark queryUserInfoTaskMark = null;
	private ForgotPasswordTaskMark forgotPasswordTaskMark = null;
	private ModifyPasswordTaskMark modifyPasswordTaskMark = null;
	private EmailSendSecurityCodeTaskMark emailSendSecurityCodeTaskMark = null;
	private EmailUserRegisterTaskMark emailUserRegisterTaskMark = null;
	private PhoneSendSecurityCodeTaskMark phoneSendSecurityCodeTaskMark = null;
	private PhoneUserRegisterTaskMark phoneUserRegisterTaskMark = null;
	private SearchResultTaskMark searchResultTaskMark = null;
	private CommentReportTaskMark commentReportTaskMark = null;
	private HomePageTaskMark homePageTaskMark = null;
	private MyArticleTaskMark myArticleTaskMark = null;
	private MyAtcommentTaskMark myAtcommentTaskMark = null;
	private MyCommentTaskMark myCommentTaskMark = null;
	private UserPostArticleTaskMark userPostArticleTaskMark = null;
	private UploadUserPostTaskMark uploadUserPostTaskMark = null;
	private UploadBusinessPhotosTaskMark uploadBusinessPhotosTaskMark = null;

	private MyUserNoticeTaskMark myUserNoticeTaskMark = null;
	private UserUploadImageTaskMark userUploadImageTaskMark = null;
	private MessageRemindTaskMark messageRemindTaskMark = null;
	private VersionInfoTaskMark versionInfoTaskMark = null;
	private SplashAdInfoTaskMark splashAdInfoTaskMark = null;
	private MyPointsDetailTaskMark myPointsDetailTaskMark;
	private LiveFeedResultTaskMark liveFeedResultTaskMark = null;
	private UserHashTaskMark userHashTaskMark = null;

	private List<FetchCityNewsTaskMark> fetchCityNewsTaskMarkList = new ArrayList<FetchCityNewsTaskMark>();
	private List<UserUpvoteTaskMark> userUpvoteTaskMarkList = new ArrayList<UserUpvoteTaskMark>();
	private List<UserDeleteUpvoteTaskMark> userDeleteUpvoteTaskMarkList = new ArrayList<UserDeleteUpvoteTaskMark>();
	private FetchEventsTaskMark fetchEventsTaskMark;
	private List<FetchEventDetailTaskMark> fetchEventDetailTaskMarkList = new ArrayList<FetchEventDetailTaskMark>();
	private List<UserFollowTaskMark> userFollowTaskMarkList = new ArrayList<UserFollowTaskMark>();
	private List<UserDeleteFollowTaskMark> userDeleteFollowTaskMarkList = new ArrayList<UserDeleteFollowTaskMark>();
	private List<FetchCityNewsDetailTaskMark> fetchCityNewsDetailTaskMarkList = new ArrayList<FetchCityNewsDetailTaskMark>();
	private List<FetchUserPostDetailTaskMark > fetchUserPostDetailTaskMarkList = new ArrayList<>();
	private List<FetchCommentsTaskMark> fetchCommentsTaskMarkList = new ArrayList<FetchCommentsTaskMark>();
	private List<SaveShareImgTaskMark> saveShareImgTaskMarkList = new ArrayList<SaveShareImgTaskMark>();
	private List<FollowedTaskMark> followedTaskMarkList = new ArrayList<FollowedTaskMark>();
	private List<FetchCityDiscountsCategoryTaskMark> fetchCityDiscountsCategoryTaskMarkList = new ArrayList<FetchCityDiscountsCategoryTaskMark>();
	private FetchCityDiscountsTaskMark fetchCityDiscountsTaskMark;
	private List<FetchDiscountDetailTaskMark> fetchDisocuntDetailTaskMarkList = new ArrayList<FetchDiscountDetailTaskMark>();
	private FetchUserPostsTaskMark fetchUserPostsTaskMark = null;
	private FetchUserBusinessImagesTaskMark fetchUserBusinessImagesTaskMark = null;
	private DeleteUserBusinessImagesTaskMark deleteUserBusinessImagesTaskMark = null;
	private FetchUserPostCategoriesTaskMark fetchUserPostCategoriesTaskMark = null;
	private List<GetUserPostsTaskMark> getUserPostsTaskMarkList = new ArrayList<>();
	private ResetPasswordTaskMark resetPasswordTaskMark = null;
	private PostPrivacySettingTaskMark postPrivacySettingTaskMark = null;
	private FetchMyUserPostCommentsTaskMark fetchMyUserPostCommentsTaskMark = null;
	private List<RenewUserPostTaskMark> renewUserPostTaskMarkList = new ArrayList<>();

	synchronized public FetchCityNewsTaskMark getFetchCityNewsTaskMarkList(String order, String category) {
		for (FetchCityNewsTaskMark taskMark : fetchCityNewsTaskMarkList) {
			if (taskMark.getOrder().equals(order) && taskMark.getCategory().equals(category)) {
				return taskMark;
			}
		}

		FetchCityNewsTaskMark taskMark = new FetchCityNewsTaskMark(order, category);
		fetchCityNewsTaskMarkList.add(taskMark);

		return taskMark;
	}

	synchronized public HomePageTaskMark getHomePageTaskMarkList() {
		if (homepageTaskMark != null) {
			return homepageTaskMark;
		}
		homepageTaskMark = new HomePageTaskMark();
		return homepageTaskMark;
	}

	synchronized public LoginTaskMark getLoginTaskMark() {
		if (loginTaskMark == null) {
			loginTaskMark = new LoginTaskMark();
		}
		return loginTaskMark;
	}

	synchronized public CountryChooseTaskMark getCountryChooseTaskMark() {
		if (countryChooseTaskMark == null) {
			countryChooseTaskMark = new CountryChooseTaskMark();
		}
		return countryChooseTaskMark;
	}

	synchronized public QueryUserInfoTaskMark getQueryUserInfoTaskMark() {
		if (queryUserInfoTaskMark == null)
			queryUserInfoTaskMark = new QueryUserInfoTaskMark();
		return queryUserInfoTaskMark;

	}

	synchronized public GetUserPostsTaskMark getUserPostsTaskMark(String page, String userId, String status) {
		for (GetUserPostsTaskMark taskMark : getUserPostsTaskMarkList) {
			if (taskMark.getPage().equals(page) && taskMark.getUserId().equals(userId) && taskMark.getStatus().equals(status)) {
				return taskMark;
			}
		}

		GetUserPostsTaskMark taskMark = new GetUserPostsTaskMark(page, userId, status);
		getUserPostsTaskMarkList.add(taskMark);

		return taskMark;
	}


	synchronized public UserUpvoteTaskMark getUserUpvoteTaskMark(String targetId, String targetType, String postId) {
		for (UserUpvoteTaskMark taskMark : userUpvoteTaskMarkList) {
			if (taskMark.getTargetId().equals(targetId) && taskMark.getTargetType().equals(targetType)
					&& taskMark.getPostId().equals(postId)) {
				return taskMark;
			}
		}

		UserUpvoteTaskMark taskMark = new UserUpvoteTaskMark(targetId, targetType, postId);
		userUpvoteTaskMarkList.add(taskMark);

		return taskMark;
	}

	synchronized public UserDeleteUpvoteTaskMark getUserDeleteUpvoteTaskMark(String targetId, String targetType,
			String postId) {
		for (UserDeleteUpvoteTaskMark taskMark : userDeleteUpvoteTaskMarkList) {
			if (taskMark.getTargetId().equals(targetId) && taskMark.getTargetType().equals(targetType)
					&& taskMark.getPostId().equals(postId)) {
				return taskMark;
			}
		}

		UserDeleteUpvoteTaskMark taskMark = new UserDeleteUpvoteTaskMark(targetId, targetType, postId);
		userDeleteUpvoteTaskMarkList.add(taskMark);

		return taskMark;
	}

	synchronized public FetchEventsTaskMark getFetchEventsTaskMark() {
		if(fetchEventsTaskMark == null){
			fetchEventsTaskMark = new FetchEventsTaskMark();
		}

		return fetchEventsTaskMark;
	}

	synchronized public ForgotPasswordTaskMark getForgotPasswordTaskMarkList() {
		if (forgotPasswordTaskMark != null) {
			return forgotPasswordTaskMark;
		}
		forgotPasswordTaskMark = new ForgotPasswordTaskMark();
		return forgotPasswordTaskMark;
	}

	synchronized public ModifyPasswordTaskMark getModifyPasswordTaskMarkList() {
		if (modifyPasswordTaskMark != null) {
			return modifyPasswordTaskMark;
		}
		modifyPasswordTaskMark = new ModifyPasswordTaskMark();
		return modifyPasswordTaskMark;
	}

	synchronized public FetchEventDetailTaskMark getFetchEventDetailTaskMark(String postId) {
		for (FetchEventDetailTaskMark taskMark : fetchEventDetailTaskMarkList) {
			if (taskMark.getPostId().equals(postId)) {
				return taskMark;
			}
		}

		FetchEventDetailTaskMark taskMark = new FetchEventDetailTaskMark(postId);
		fetchEventDetailTaskMarkList.add(taskMark);

		return taskMark;
	}

	synchronized public UserFollowTaskMark getUserFollowTaskMark(String postId) {
		for (UserFollowTaskMark taskMark : userFollowTaskMarkList) {
			if (taskMark.getPostId().equals(postId)) {
				return taskMark;
			}
		}

		UserFollowTaskMark taskMark = new UserFollowTaskMark(postId);
		userFollowTaskMarkList.add(taskMark);

		return taskMark;
	}

	synchronized public UserDeleteFollowTaskMark getUserDeleteFollowTaskMark(String postId) {
		for (UserDeleteFollowTaskMark taskMark : userDeleteFollowTaskMarkList) {
			if (taskMark.getPostId().equals(postId)) {
				return taskMark;
			}
		}

		UserDeleteFollowTaskMark taskMark = new UserDeleteFollowTaskMark(postId);
		userDeleteFollowTaskMarkList.add(taskMark);

		return taskMark;
	}

	synchronized public EmailSendSecurityCodeTaskMark getEmailSendSecurityCodeTaskMarkList() {
		if (emailSendSecurityCodeTaskMark != null) {
			return emailSendSecurityCodeTaskMark;
		}
		emailSendSecurityCodeTaskMark = new EmailSendSecurityCodeTaskMark();
		return emailSendSecurityCodeTaskMark;
	}

	synchronized public EmailUserRegisterTaskMark getEmailUserRegisterTaskMarkList() {
		if (emailUserRegisterTaskMark != null) {
			return emailUserRegisterTaskMark;
		}
		emailUserRegisterTaskMark = new EmailUserRegisterTaskMark();
		return emailUserRegisterTaskMark;
	}

	synchronized public PhoneSendSecurityCodeTaskMark getPhoneSendSecurityCodeTaskMarkList() {
		if (phoneSendSecurityCodeTaskMark != null) {
			return phoneSendSecurityCodeTaskMark;
		}
		phoneSendSecurityCodeTaskMark = new PhoneSendSecurityCodeTaskMark();
		return phoneSendSecurityCodeTaskMark;
	}

	synchronized public PhoneUserRegisterTaskMark getPhonelUserRegisterTaskMarkList() {
		if (phoneUserRegisterTaskMark != null) {
			return phoneUserRegisterTaskMark;
		}
		phoneUserRegisterTaskMark = new PhoneUserRegisterTaskMark();
		return phoneUserRegisterTaskMark;
	}

	public SearchKeyWordTaskMark createSearchKeyWordTaskMarkList() {
		return new SearchKeyWordTaskMark();
	}

	synchronized public FetchCityNewsDetailTaskMark getFetchCityNewsDetailTaskMark(String postId) {
		for (FetchCityNewsDetailTaskMark taskMark : fetchCityNewsDetailTaskMarkList) {
			if (taskMark.getPostId().equals(postId)) {
				return taskMark;
			}
		}

		FetchCityNewsDetailTaskMark taskMark = new FetchCityNewsDetailTaskMark(postId);
		fetchCityNewsDetailTaskMarkList.add(taskMark);

		return taskMark;
	}

	synchronized public FetchUserPostDetailTaskMark getFetchUserPostDetailTaskMark(String postId) {
		for (FetchUserPostDetailTaskMark taskMark : fetchUserPostDetailTaskMarkList) {
			if (taskMark.getPostId().equals(postId)) {
				return taskMark;
			}
		}

		FetchUserPostDetailTaskMark taskMark = new FetchUserPostDetailTaskMark(postId);
		fetchUserPostDetailTaskMarkList.add(taskMark);

		return taskMark;
	}

	public UserInsertCommentTaskMark createUserInsertCommentTaskMark(String postId, String userCommentContent,
			String commentParentId) {

		return new UserInsertCommentTaskMark(postId, userCommentContent, commentParentId);
	}

	synchronized public FetchCommentsTaskMark getFetchCommentsTaskMark(String postId) {
		for (FetchCommentsTaskMark taskMark : fetchCommentsTaskMarkList) {
			if (taskMark.getPostId().equals(postId)) {
				return taskMark;
			}
		}

		FetchCommentsTaskMark taskMark = new FetchCommentsTaskMark(postId);
		fetchCommentsTaskMarkList.add(taskMark);

		return taskMark;
	}

	synchronized public SearchResultTaskMark getSearchResultTaskMark() {
		if (searchResultTaskMark != null) {
			return searchResultTaskMark;
		}

		searchResultTaskMark = new SearchResultTaskMark();
		return searchResultTaskMark;
	}

	public SearchResultTaskMark createSearchResultTaskMark() {
		return new SearchResultTaskMark();
	}

	public LiveFeedResultTaskMark getLiveFeedResultTaskMark() {
		if (liveFeedResultTaskMark != null) {
			return liveFeedResultTaskMark;
		}

		liveFeedResultTaskMark = new LiveFeedResultTaskMark();
		return liveFeedResultTaskMark;
	}

	synchronized public HomePageTaskMark getHomePageTaskMark() {
		if (homePageTaskMark != null) {
			return homePageTaskMark;
		}

		homePageTaskMark = new HomePageTaskMark();
		return homePageTaskMark;
	}

	synchronized public SaveShareImgTaskMark getSaveShareImgTaskMark(String imgUrl) {
		for (SaveShareImgTaskMark taskMark : saveShareImgTaskMarkList) {
			if (taskMark.getImgUrl().equals(imgUrl)) {
				return taskMark;
			}
		}

		SaveShareImgTaskMark taskMark = new SaveShareImgTaskMark(imgUrl);
		saveShareImgTaskMarkList.add(taskMark);

		return taskMark;
	}

	synchronized public CommentReportTaskMark getCommentReportTaskMark() {
		if (commentReportTaskMark != null) {
			return commentReportTaskMark;
		}

		commentReportTaskMark = new CommentReportTaskMark();
		return commentReportTaskMark;
	}

	synchronized public MyArticleTaskMark getMyArticleTaskMark() {
		if (myArticleTaskMark != null) {
			return myArticleTaskMark;
		}

		myArticleTaskMark = new MyArticleTaskMark();
		return myArticleTaskMark;
	}

	synchronized public FollowedTaskMark getFollowedTaskMarkTaskMark(String category, String tagsType) {
		for (FollowedTaskMark taskMark : followedTaskMarkList) {
			if (taskMark.getCategory().equals(category) && taskMark.getTagType().equals(tagsType)) {
				return taskMark;
			}
		}

		FollowedTaskMark taskMark = new FollowedTaskMark(category, tagsType);
		followedTaskMarkList.add(taskMark);
		return taskMark;
	}

	synchronized public MyAtcommentTaskMark getMyAtcommentTaskMark() {
		if (myAtcommentTaskMark != null) {
			return myAtcommentTaskMark;
		}

		myAtcommentTaskMark = new MyAtcommentTaskMark();
		return myAtcommentTaskMark;
	}

	synchronized public MyCommentTaskMark getMyCommentTaskMark() {
		if (myCommentTaskMark != null) {
			return myCommentTaskMark;
		}

		myCommentTaskMark = new MyCommentTaskMark();
		return myCommentTaskMark;
	}

	synchronized public FetchMyUserPostCommentsTaskMark getMyUserPostCommentsTaskMark() {
		if (fetchMyUserPostCommentsTaskMark  != null) {
			return fetchMyUserPostCommentsTaskMark ;
		}

		fetchMyUserPostCommentsTaskMark  = new FetchMyUserPostCommentsTaskMark();
		return fetchMyUserPostCommentsTaskMark ;
	}

	synchronized public UserPostArticleTaskMark getUserPostArticleTaskMark() {
		if (userPostArticleTaskMark != null) {
			return userPostArticleTaskMark;
		}

		userPostArticleTaskMark = new UserPostArticleTaskMark();
		return userPostArticleTaskMark;
	}

	synchronized public UploadUserPostTaskMark getUploadUserPostTaskMark() {
		if (uploadUserPostTaskMark != null) {
			return uploadUserPostTaskMark;
		}

		uploadUserPostTaskMark = new UploadUserPostTaskMark();
		return uploadUserPostTaskMark;
	}

	synchronized public UploadBusinessPhotosTaskMark getUploadBusinessPhotosTaskMark() {
		if (uploadBusinessPhotosTaskMark != null) {
			return uploadBusinessPhotosTaskMark;
		}

		uploadBusinessPhotosTaskMark = new UploadBusinessPhotosTaskMark();
		return uploadBusinessPhotosTaskMark;
	}

	synchronized public FetchCityDiscountsTaskMark getFetchCityDiscountsTaskMark() {
		if(fetchCityDiscountsTaskMark == null){
			fetchCityDiscountsTaskMark = new FetchCityDiscountsTaskMark();
		}

		return fetchCityDiscountsTaskMark;
	}

	synchronized public FetchCityDiscountsCategoryTaskMark getFetchCityDiscountsCategoryTaskMark(String category,
			String subcategory, String city, String filter, String sort) {
		for (FetchCityDiscountsCategoryTaskMark taskMark : fetchCityDiscountsCategoryTaskMarkList) {
			if (taskMark.getCategory().equals(category) && taskMark.getSubcategory().equals(subcategory)
					&& taskMark.getCity().equals(city) && taskMark.getFilter().equals(filter)
					&& taskMark.getSort().equals(sort)) {
				return taskMark;
			}
		}

		FetchCityDiscountsCategoryTaskMark taskMark = new FetchCityDiscountsCategoryTaskMark(category, subcategory,
				city, filter, sort);
		fetchCityDiscountsCategoryTaskMarkList.add(taskMark);
		return taskMark;
	}

	public UserDeleteCommentTaskMark createUserDeleteCommentTaskMark(String commentId, String postId) {
		return new UserDeleteCommentTaskMark(commentId, postId);
	}

	synchronized public MyUserNoticeTaskMark getMyUserNoticeTaskMark() {
		if (myUserNoticeTaskMark == null) {
			myUserNoticeTaskMark = new MyUserNoticeTaskMark();
		}
		return myUserNoticeTaskMark;
	}

	synchronized public FetchDiscountDetailTaskMark getFetchDiscountDetailTaskMark(String postId) {
		for (FetchDiscountDetailTaskMark taskMark : fetchDisocuntDetailTaskMarkList) {
			if (taskMark.getPostId().equals(postId)) {
				return taskMark;
			}
		}

		FetchDiscountDetailTaskMark taskMark = new FetchDiscountDetailTaskMark(postId);
		fetchDisocuntDetailTaskMarkList.add(taskMark);

		return taskMark;
	}

	synchronized public UserUploadImageTaskMark getUserUploadImageTaskMark() {
		if (userUploadImageTaskMark == null) {
			userUploadImageTaskMark = new UserUploadImageTaskMark();
		}
		return userUploadImageTaskMark;
	}

	public UserRateTaskMark createUserRateTaskMark(String postId, float rating) {
		return new UserRateTaskMark(postId, rating);
	}

	public AddUserTokenTaskMark createAddUserTokenTaskMark() {
		return new AddUserTokenTaskMark();
	}

	public UserDeleteArticleTaskMark createUserDeleteArticleTaskMark(String postId) {
		return new UserDeleteArticleTaskMark(postId);
	}

	public MessageRemindTaskMark createMessageRemindTaskMark() {
		return new MessageRemindTaskMark();
	}

	public UserGetNoticationSettingTaskMark createUserGetNoticationSettingTaskMark() {
		return new UserGetNoticationSettingTaskMark();
	}

	public UserGetAuidTaskMark createUserGetAuidTaskMark(){
		return new UserGetAuidTaskMark();
	}
	public VersionInfoTaskMark getVersionTaskMark(){
		if (versionInfoTaskMark == null) {
			versionInfoTaskMark = new VersionInfoTaskMark();
		}
		return versionInfoTaskMark;
	}

	public SplashAdInfoTaskMark getSplashAdTaskMark(){
		if (splashAdInfoTaskMark == null) {
			splashAdInfoTaskMark = new SplashAdInfoTaskMark();
		}
		return splashAdInfoTaskMark;
	}

	public UserHashTaskMark getUserHashTaskMark(){
		if (userHashTaskMark == null) {
			userHashTaskMark = new UserHashTaskMark();
		}
		return userHashTaskMark;
	}

	synchronized public MyPointsDetailTaskMark getMyPointsDetailTaskMark() {
		if (myPointsDetailTaskMark == null) {
			myPointsDetailTaskMark = new MyPointsDetailTaskMark();
		}
		return myPointsDetailTaskMark;
	}

	synchronized public HomeMapTaskMark createHomeMapTaskMark(){
		return new HomeMapTaskMark();
	}

	synchronized public FetchUserPostsTaskMark getFetchUserPostsTaskMark() {
		if(fetchUserPostsTaskMark == null){
			fetchUserPostsTaskMark = new FetchUserPostsTaskMark();
		}

		return fetchUserPostsTaskMark;
	}

	synchronized public FetchUserBusinessImagesTaskMark getFetchUserBusinessImagesTaskMark() {
		if(fetchUserBusinessImagesTaskMark == null){
			fetchUserBusinessImagesTaskMark = new FetchUserBusinessImagesTaskMark();
		}

		return fetchUserBusinessImagesTaskMark;
	}

	synchronized public DeleteUserBusinessImagesTaskMark getDeleteUserBusinessImagesTaskMark() {
		if(deleteUserBusinessImagesTaskMark == null){
			deleteUserBusinessImagesTaskMark = new DeleteUserBusinessImagesTaskMark();
		}

		return deleteUserBusinessImagesTaskMark;
	}

	synchronized public FetchUserPostCategoriesTaskMark getFetchUserPostCategoriesTaskMark() {
		if(fetchUserPostCategoriesTaskMark == null){
			fetchUserPostCategoriesTaskMark = new FetchUserPostCategoriesTaskMark();
		}

		return fetchUserPostCategoriesTaskMark ;
	}

	synchronized public ResetPasswordTaskMark getResetPasswordTaskMark() {
		if (resetPasswordTaskMark == null) {
			resetPasswordTaskMark = new ResetPasswordTaskMark();
		}

		return resetPasswordTaskMark;
	}

	synchronized public PostPrivacySettingTaskMark getPostPrivacySettingTaskMark() {
		if (postPrivacySettingTaskMark == null) {
			postPrivacySettingTaskMark = new PostPrivacySettingTaskMark();
		}

		return postPrivacySettingTaskMark;
	}

	synchronized public RenewUserPostTaskMark getRenewUserPostTaskMark(String postId) {
		for (RenewUserPostTaskMark taskMark : renewUserPostTaskMarkList) {
			if (taskMark.getPostId().equals(postId)) {
				return taskMark;
			}
		}

		RenewUserPostTaskMark taskMark = new RenewUserPostTaskMark(postId);
		renewUserPostTaskMarkList.add(taskMark);
		return taskMark;
	}

	@Override
	public synchronized void reinitForLongLive() {
		fetchCityNewsTaskMarkList.clear();
		homepageTaskMark = null;
		loginTaskMark = null;
		countryChooseTaskMark = null;
		queryUserInfoTaskMark = null;
		userUpvoteTaskMarkList.clear();
		fetchEventsTaskMark = null;
		forgotPasswordTaskMark = null;
		modifyPasswordTaskMark = null;
		fetchEventDetailTaskMarkList.clear();
		userFollowTaskMarkList.clear();
		userDeleteFollowTaskMarkList.clear();
		emailSendSecurityCodeTaskMark = null;
		emailUserRegisterTaskMark = null;
		phoneSendSecurityCodeTaskMark = null;
		phoneUserRegisterTaskMark = null;
		userDeleteUpvoteTaskMarkList.clear();
		fetchCityNewsDetailTaskMarkList.clear();
		fetchCommentsTaskMarkList.clear();
		searchResultTaskMark = null;
		saveShareImgTaskMarkList.clear();
		commentReportTaskMark = null;
		homePageTaskMark = null;
		myArticleTaskMark = null;
		followedTaskMarkList.clear();
		myAtcommentTaskMark = null;
		myCommentTaskMark = null;
		userPostArticleTaskMark = null;
		fetchCityDiscountsTaskMark = null;
		fetchCityDiscountsCategoryTaskMarkList.clear();
		myUserNoticeTaskMark = null;
		fetchDisocuntDetailTaskMarkList.clear();
		userUploadImageTaskMark = null;
		messageRemindTaskMark = null;
		versionInfoTaskMark = null;
		myPointsDetailTaskMark = null;
		liveFeedResultTaskMark = null;
		fetchUserPostsTaskMark = null;
		fetchUserPostCategoriesTaskMark = null;
		uploadUserPostTaskMark = null;
		fetchMyUserPostCommentsTaskMark= null;
		uploadBusinessPhotosTaskMark = null;
		fetchUserBusinessImagesTaskMark = null;
		deleteUserBusinessImagesTaskMark = null;
		renewUserPostTaskMarkList.clear();
		userHashTaskMark = null;
		splashAdInfoTaskMark = null;
	}

}
